<template>
    <div class="node_box">
        <div class="node_body">
            <component :is="componentTypes[nodeConfig.type]" :nodeConfig="nodeConfig"></component>
            <div>
                <insertBtn :nodeConfig="nodeConfig" />
            </div>
        </div>
    </div>
</template>

<script lang="ts" setup>
let props = defineProps(['nodeConfig']); //数组|对象写法都可以
let $emit = defineEmits(['xxx','click']);
import sp from './sp.vue'
import cs from './cs.vue'
import condition from './condition.vue'
import branch from './branch.vue'
import InsertBtn from '../insertBtn.vue'

const componentTypes = {
  SP: sp,
  CS: cs,
  BRANCH: branch,
  CONDITION: condition,
}
</script>

<style lang="scss" scoped>
.node_box {
    display: flex;
    // width: 100%;
    flex-flow: column wrap;
    justify-content: flex-start;
    align-items: center;
    padding: 0;
}

.node_body {
    // display: flex;
    // flex-direction: column;
    // justify-content: center;
    // align-items: center;
}

.insertBtn {
    position: relative;
    z-index: 1;
}

</style>
